import { ui } from "../ui/layaMaxUI";
import sceneutil from "../utils/sceneutil";

export default class yonghushaidan extends Laya.Script {
    constructor() {
        super();
    }

    onEnable() {
        let panel = this.owner.getChildByName("box1").getChildByName('panel') as Laya.Panel;
        panel.vScrollBarSkin = "";


        let btnClose = this.owner.getChildByName('btnclose') as Laya.Sprite;
        btnClose.on("click", this, () => {
            sceneutil.Instance.hideBlackBack()
            Laya.Scene.close("yonghushaidan.scene");
        })

        let box1 = this.owner.getChildByName("box1") as Laya.Box;
        let shaidanyouli = this.owner.getChildByName("box1").getChildByName("shaidanyouli") as Laya.Sprite;
        shaidanyouli.on("click", this, () => {
            box1.visible = false;
            box2.visible = true;
            box3.visible = false;
        })

        let box2 = this.owner.getChildByName("box2") as Laya.Box;
        let shaidan = box2.getChildByName('shaidan') as Laya.Sprite;
        shaidan.on("click", this, () => {
            box2.visible = false;
            box1.visible = false;
            box3.visible = true;
        })

        let box3 = this.owner.getChildByName("box3") as Laya.Box;
        let tijiao = box3.getChildByName("tijiao") as Laya.Sprite;
        tijiao.on("click", this, () => {
            sceneutil.Instance.hideBlackBack()
            Laya.Scene.close("yonghushaidan.scene");
        })

        box1.visible = true;
        box2.visible = false;
        box3.visible=false;
    }
}